package com.presto.directo.mvvm.view

import android.os.Bundle
import android.view.View
import androidx.core.view.isVisible
import com.presto.directo.base.BaseActivity
import com.presto.directo.databinding.ActivitySettingBinding
import com.presto.directo.utils.*

class SettingActivity : BaseActivity() {

    private val binding by lazy { ActivitySettingBinding.inflate(layoutInflater) }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding.tvVersion.text = "Versión ${getAppVersion()}"
        binding.btnLogout.isVisible = UserUtil.isLogin()
        binding.btnLogout.setOnClickListener {
            SPUtil.putObject(UserUtil.USER, null)
            exit()
        }
    }

    override val rootView: View
        get() = binding.root

}